#include <cstdio>
#include <cmath>

const int MAX = 10000;

int main()
{
  int t,ca,cb;
  double p1x,p1y,p2x,p2y,p3x,p3y,a,b,c,k,d,area,stepx,nowx,nowy1,nowy2;
  while(scanf("%d", &t) != EOF )
  {
    for(ca=0;ca<t;ca++)
    {
        scanf("%lf%lf%lf%lf%lf%lf",&p1x,&p1y,&p2x,&p2y,&p3x,&p3y);
        k=(p3y-p2y)/(p3x-p2x);
        d=p3y-k*p3x;
        a=(p2y-p1y)/((p2x-p1x)*(p2x-p1x));
        b=-2*a*p1x;
        c=p1y+a*p1x*p1x;
        area=0;stepx=(p3x-p2x)/MAX;nowx=p2x;
        for(cb=0;cb<MAX;cb++)
        {
          nowx+=stepx;
          nowy1=k*nowx+d;
          nowy2=a*nowx*nowx+b*nowx+c;
          area+=stepx*(nowy2-nowy1);
        }
        printf("%.2lf\n", area);
    }
  }
  return 0;
}
